<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>面向对象编程思想</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-section {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            position: relative;
            overflow: hidden;
        }
        
        .hero-section::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
            animation: float 20s ease-in-out infinite;
        }
        
        @keyframes float {
            0%, 100% { transform: translate(0, 0) rotate(0deg); }
            50% { transform: translate(-30px, -30px) rotate(180deg); }
        }
        
        .content-card {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
        }
        
        .content-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
        }
        
        .section-title {
            position: relative;
            display: inline-block;
            font-family: 'Noto Serif SC', serif;
        }
        
        .section-title::after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 0;
            width: 60px;
            height: 4px;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 12px;
            padding: 24px;
            overflow-x: auto;
            font-family: 'Consolas', 'Monaco', monospace;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        }
        
        .concept-card {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            color: white;
            padding: 30px;
            border-radius: 16px;
            position: relative;
            overflow: hidden;
            transition: all 0.3s ease;
        }
        
        .concept-card::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
        }
        
        .concept-card:hover {
            transform: scale(1.05);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
        }
        
        .feature-icon {
            width: 60px;
            height: 60px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            margin-bottom: 16px;
        }
        
        .example-card {
            background: #f8f9fa;
            border-left: 4px solid #667eea;
            padding: 20px;
            border-radius: 8px;
            margin: 16px 0;
        }
        
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 40px 0;
        }
        
        .homework-item {
            background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
            color: white;
            padding: 20px;
            border-radius: 12px;
            margin: 12px 0;
            position: relative;
            overflow: hidden;
        }
        
        .homework-item::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 50px;
            height: 100%;
            background: rgba(255, 255, 255, 0.1);
            transform: skewX(-20deg);
            transition: all 0.3s ease;
        }
        
        .homework-item:hover::before {
            width: 100%;
        }
        
        .drop-cap {
            float: left;
            font-size: 4em;
            line-height: 0.8;
            margin: 0 8px 0 0;
            font-weight: 700;
            color: #667eea;
            font-family: 'Noto Serif SC', serif;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-section text-white py-20 px-8 relative">
        <div class="max-w-6xl mx-auto relative z-10">
            <h1 class="text-5xl md:text-7xl font-bold mb-6 animate-pulse">面向对象编程思想</h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">探索现代编程的核心理念，构建优雅而强大的软件系统</p>
            <div class="flex items-center space-x-4">
                <i class="fas fa-code text-3xl"></i>
                <span class="text-lg">深入理解 OOP 的精髓</span>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="max-w-6xl mx-auto px-8 py-16">
        <!-- Introduction Section -->
        <section class="content-card rounded-2xl p-10 mb-12">
            <h2 class="section-title text-3xl font-bold mb-8">什么是面向对象思想？</h2>
            <p class="text-lg leading-relaxed mb-6">
                <span class="drop-cap">面</span>向对象编程（Object-Oriented Programming，OOP）是一种软件开发方法，它以对象为中心，将数据和操作封装在一起，通过对象之间的交互来实现程序的功能。面向对象的思想强调程序的组件化、可重用性和易维护性。
            </p>
            
            <!-- Core Concepts Visualization -->
            <div class="mermaid">
                <script type="text/mermaid">
                    graph TD
                        A[面向对象编程] --> B[封装]
                        A --> C[继承]
                        A --> D[多态]
                        B --> E[数据隐藏]
                        B --> F[接口统一]
                        C --> G[代码复用]
                        C --> H[层次结构]
                        D --> I[灵活性]
                        D --> J[扩展性]
                        
                        style A fill:#667eea,stroke:#fff,stroke-width:3px,color:#fff
                        style B fill:#f093fb,stroke:#fff,stroke-width:2px,color:#fff
                        style C fill:#f093fb,stroke:#fff,stroke-width:2px,color:#fff
                        style D fill:#f093fb,stroke:#fff,stroke-width:2px,color:#fff
                </script>
            </div>
        </section>

        <!-- Three Pillars of OOP -->
        <section class="grid md:grid-cols-3 gap-8 mb-16">
            <div class="concept-card">
                <div class="relative z-10">
                    <div class="feature-icon">
                        <i class="fas fa-box"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-4">封装</h3>
                    <p class="text-lg">将数据和操作封装在一个类中，对外部隐藏对象的内部细节，提供统一的访问接口。</p>
                </div>
            </div>
            
            <div class="concept-card" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);">
                <div class="relative z-10">
                    <div class="feature-icon">
                        <i class="fas fa-sitemap"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-4">继承</h3>
                    <p class="text-lg">通过继承机制，子类可以继承父类的属性和方法，并可以在此基础上进行扩展或修改。</p>
                </div>
            </div>
            
            <div class="concept-card" style="background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);">
                <div class="relative z-10">
                    <div class="feature-icon">
                        <i class="fas fa-shapes"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-4">多态</h3>
                    <p class="text-lg">不同类的对象可以对同一消息做出不同的响应，即同一个方法在不同对象中具有不同的行为。</p>
                </div>
            </div>
        </section>

        <!-- Real World Example -->
        <section class="content-card rounded-2xl p-10 mb-12">
            <h2 class="section-title text-3xl font-bold mb-8">生活中的面向对象</h2>
            <div class="example-card">
                <h4 class="text-xl font-bold mb-3 text-purple-700">
                    <i class="fas fa-car mr-2"></i>汽车的例子
                </h4>
                <p class="text-lg leading-relaxed">
                    在面向对象的观点下，汽车可以被看作是一个类，具有属性（如颜色、型号、速度等）和方法（如加速、刹车、转向等）。每一辆具体的汽车都是这个类的实例对象。
                </p>
            </div>
        </section>

        <!-- Class and Object -->
        <section class="content-card rounded-2xl p-10 mb-12">
            <h2 class="section-title text-3xl font-bold mb-8">类和对象的基本概念</h2>
            
            <div class="grid md:grid-cols-2 gap-8 mb-8">
                <div class="bg-purple-50 p-6 rounded-lg">
                    <h3 class="text-2xl font-bold mb-4 text-purple-700">
                        <i class="fas fa-cube mr-2"></i>类（Class）
                    </h3>
                    <ul class="space-y-2 text-lg">
                        <li><i class="fas fa-check text-purple-500 mr-2"></i>类是一种抽象数据类型，用来描述具有相同属性和行为的对象集合</li>
                        <li><i class="fas fa-check text-purple-500 mr-2"></i>类可以看作是对象的模板或蓝图，定义了对象的结构和行为</li>
                        <li><i class="fas fa-check text-purple-500 mr-2"></i>类可以包含成员变量（属性）和成员方法（行为）</li>
                    </ul>
                </div>
                
                <div class="bg-blue-50 p-6 rounded-lg">
                    <h3 class="text-2xl font-bold mb-4 text-blue-700">
                        <i class="fas fa-cubes mr-2"></i>对象（Object）
                    </h3>
                    <ul class="space-y-2 text-lg">
                        <li><i class="fas fa-check text-blue-500 mr-2"></i>对象是类的实例化，是具体存在的实体</li>
                        <li><i class="fas fa-check text-blue-500 mr-2"></i>对象具有唯一的标识符，可以访问类中定义的成员变量和成员方法</li>
                        <li><i class="fas fa-check text-blue-500 mr-2"></i>对象可以根据类的定义创建多个实例，每个实例之间相互独立</li>
                    </ul>
                </div>
            </div>

            <!-- Code Example -->
            <div class="code-block">
                <pre><code><span style="color: #569cd6;">class</span> <span style="color: #4ec9b0;">Car</span> {
    <span style="color: #608b4e;">// 类的属性</span>
    <span style="color: #4ec9b0;">String</span> brand;
    <span style="color: #4ec9b0;">String</span> color;
    <span style="color: #569cd6;">int</span> year;

    <span style="color: #608b4e;">// 类的方法</span>
    <span style="color: #569cd6;">void</span> <span style="color: #dcdcaa;">drive</span>() {
        System.out.<span style="color: #dcdcaa;">println</span>(<span style="color: #ce9178;">"Driving the "</span> + color + <span style="color: #ce9178;">" "</span> + brand);
    }
}

<span style="color: #569cd6;">public class</span> <span style="color: #4ec9b0;">Main</span> {
    <span style="color: #569cd6;">public static void</span> <span style="color: #dcdcaa;">main</span>(<span style="color: #4